<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <div th:replace="fragments/resourceLink :: resourceLink"></div>
    <title>PS&Modifydata</title>
    <script src='../../../resources/js/modifydata.js'></script>
</head>
<body>

<div class="container">
    <div class="row clearfix">
        <div class="row clearfix">
            <div class="col-md-12 column">
                <div class="page-header">
                    <h1>
                        校園心裏輔導系統
                        <small>信息完善</small>
                    </h1>

                </div>
                <hr>
            </div>
            <div class="col-md-12 column">
                <div class="navbar navbar-inverse" th:replace="fragments/headmanager :: headmanager">
                </div>
            </div>
        </div>
        </br>
        <div class="col-md-12 column">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        信息完善
                    </h3>
                </div>
                <div class="panel-body">
                    <ul id="myTab" class="nav nav-tabs">
                        <li class="active"><a href="#home" data-toggle="tab">信息完善</a></li>
                        <li><a href="#modify" data-toggle="tab">修改密码</a></li>
                    </ul>
                    <div id="myTabContent" class="tab-content">
                        <div class="tab-pane fade in active" id="home">
                            <form role="form" class="form-horizontal" action="/modifydata" method="post">
                                <input type="hidden" name="token" value="${token}"/>
                                <div class="form-group">
                                    <label for="name">名字</label>
                                    <input type="text" name="userName" id="name" class="form-control" th:text="${session.user.userName}">
                                    <span class="error"></span>
                                </div>

                                <div class="form-group">
                                    <label for="email">邮箱地址</label>
                                    <input type="email" name="userEmail" id="email" class="form-control" th:text="${session.user.userEmail}">
                                    <span class="error"></span>
                                </div>

                                <div class="form-group">
                                    <label for="phone">手机号码</label>
                                    <input type="text" name="mobilePhone" id="phone" class="form-control" th:text="${session.user.mobilePhone}">
                                </div>

                                <div class="form-group">
                                    <label for="modifyInput5" class="control-label col-md-2">角色</label>
                                        <select id="modifyInput5" class="form-control">
                                            <option value = 0>普通用户</option>
                                            <option value = 1>学生</option>
                                            <option value = 2>教师</option>
                                        </select>
                                </div>
                                <div class="form-group">
                                    <label for="phone">学号（学生必填）</label>
                                    <input type="text" name="studentNumber" class="form-control" >
                                </div>

                                <div class="CTA">
                                    <input type="submit" value="修改信息" onclick="modify();">
                                </div>
                            </form>
                            <!-- End Signup Form -->
                        </div>
                       <!-- <div class="tab-pane fade" id="find">
                            <form role="form" class="form-horizontal" method="post" action="/forgetPassword">
                                <input type="hidden" name="token" value="${token}"/>
                                <div class="form-group">
                                    <label for="modifyinput">邮箱</label>
                                    <input type="text" name="userEmail" id="modifyinput" class="form-control">
                                    <span class="error"></span>
                                </div>
                                <div class="CTA">
                                    <input type="submit" value="提交" class="btn btn-default">
                                </div>
                            </form>
                        </div>-->
                        <!-- End Signup Form -->
                        <div class="tab-pane fade" id="modify">
                            <form role="form" class="form-horizontal" >
                                <input type="hidden" name="token" value="${token}"/>
                                <div class="form-group">
                                    <label for="modifyinput1">邮箱</label>
                                    <input type="text" name="userEmail" id="modifyinput1" class="form-control">
                                    <span class="error"></span>
                                </div>
                                <div class="form-group">
                                    <label for="modifyinput2">密码</label>
                                    <input type="password" name="Password" id="modifyinput2" class="form-control">
                                    <span id="passerror"></span>
                                </div>
                                <div class="form-group">
                                    <label for="modifyinput3">确认密码</label>
                                    <input type="password" name="passwordCon" id="modifyinput3" class="form-control">
                                    <span class="error"></span>
                                </div>
                                <div class="CTA">
                                    <button class="btn btn-default" type="button" onclick="modifydata()">修改信息</button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>

            </div>

        </div>
    </div>
</div>
</div>


</body>
</html>
